var mychart = echarts.init(document.getElementById("b1"));

var option ={
    xAxis: {},
    yAxis: {},
    series:{
        type:'scatter',
        data:[[1,1,20],[2,3,13],[7,6,27]],
        symbolSize: function(x){
            return x[2];
        },
    },
    title:{
        text:'简单气泡图',
        subtext:'沈林涛',
    },
};
mychart.setOption(option);

function getRandInt(min,max){
    return Math.floor(Math.random() * (max - min) ) + min;
}


var myChart2 = echarts.init(document.getElementById("b2"))
var option2 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--沈林涛',
        left: 'center',
    },
    series:{
        type:'effectScatter',
        data:[[1,1,20],[2,3,39],[5,2,13],[7,6,27]],
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart2.setOption(option2);

function getRandInt(a,b){
    return Math.floor(a + (b-a)*Math.random());a;
}
var myChart3 = echarts.init(document.getElementById("b3"))
var x,y,z;
var ndata = [];
for(var i=0;i<50;i++){
    x = getRandInt(1,100);
    y = getRandInt(1,100);
    z = getRandInt(2,25);
    ndata.push([x,y,z])
}
var option3 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--沈林涛',
        left: 'center',
    },
    series:{
        type:'scatter',
        data:ndata,
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart3.setOption(option3);

function getRandInt(a,b){
    return Math.floor(a + (b-a)*Math.random())
}
var myChart4 = echarts.init(document.getElementById("b4"))
var x,y,z;
var ndata = [];
for(var i=0;i<50;i++){
    x = getRandInt(1,100);
    y = getRandInt(1,100);
    z = getRandInt(2,25);
    ndata.push([x,y,z])
}
var option4 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--沈林涛',
        left: 'center',
    },
    series:{
        type:'scatter',
        data:ndata,
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart4.setOption(option4);
setInterval(function(){
    var x,y,z;
    var ndata = [];
    for(var i=0;i<50;i++){
        x = getRandInt(1,100);
        y = getRandInt(1,100);
        z = getRandInt(2,25);
        ndata.push([x,y,z])
};
    option4.series.data = ndata;
    myChart4.setOption(option4);
},1000)
